package br.com.SAM.teste;

import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TesteRapido {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 String result="";
		 String teste ="<em> teste </em>"+
		 "<li> teste <br>&nbsp;</li>";
		 teste = teste.replaceAll("&nbsp;", "");
		 
		 teste = teste.replaceAll("<", " <");
		 teste = teste.replaceAll(">", "> ");
		 System.out.println("depois do replace " +teste);
		 StringTokenizer token = new StringTokenizer(teste);
		 while(token.hasMoreElements()){
			 String t = token.nextToken();
			 
			 Pattern p = Pattern.compile("<[^>]*>");
			 Matcher m = p.matcher(t);
			 boolean b = m.matches();
			 if(!b){
				 result+=" "+t;
			 }
			 System.out.println(t+" >> "+b);
			 
		 }
		 if ("".equalsIgnoreCase(result)|| result == null){
			 System.out.println("vazio");
		 }
		 else{
			 System.out.println(result);
		 }
		 
		 
		
		 

	}

}
